package com.tavio.vaultboy.element;

import org.andengine.entity.sprite.Sprite;
import org.andengine.opengl.texture.region.ITextureRegion;
import org.andengine.opengl.vbo.VertexBufferObjectManager;

import com.tavio.vaultboy.element.state.FallingState;
import com.tavio.vaultboy.element.type.ElementType;

public abstract class SpriteElement extends Element{

	private Sprite sprite;
	
	private FallingState fallingState;
	
	public SpriteElement(ElementType elementType, float x, float y, float width, float height,
			float acceleration, ITextureRegion tiledTextureRegion, VertexBufferObjectManager vertexBufferObjectManager) {
		super(elementType, x, y, width, height, acceleration, vertexBufferObjectManager);
		sprite = new Sprite(x, y, width, height, tiledTextureRegion, vertexBufferObjectManager);
		sprite.setZIndex(2);
	}
	
	public abstract void updatePositionAndCheckCollisions(float timeElapsed);
	
	public Sprite getSprite() {
		return sprite;
	}

	public FallingState getFallingState() {
		return fallingState;
	}

	public void setFallingState(FallingState fallingState) {
		this.fallingState = fallingState;
	}
	
}
